package test3_17.Auto;

public class Car extends Auto {
    /*
    再定义一个小汽车类Car，继承Auto，并添加空调、CD等成员变量，覆盖加速，减速的方法
     */
    private boolean airConditioner;
    private boolean CD;

    public Car(boolean airConditioner, boolean CD) {
        this.airConditioner = airConditioner;
        this.CD = CD;
    }

    public void judege(){
        if (this.airConditioner == true) {
            System.out.println("有空调");
        }else {
            System.out.println("没空调");
        }
        if (this.CD == true) {
            System.out.println("有CD");
        }else {
            System.out.println("没CD");
        }
    }

    @Override
    public void speedUp(int n) {
        super.speedUp(n);
    }

    @Override
    public void speedDown(int m) {
        super.speedUp(m);
    }


    public boolean isAirConditioner() {
        return airConditioner;
    }

    public void setAirConditioner(boolean airConditioner) {
        this.airConditioner = airConditioner;
    }

    public boolean isCD() {
        return CD;
    }

    public void setCD(boolean CD) {
        this.CD = CD;
    }
}
